package com.aob.service.impl;

import com.aob.pojo.Book;
import com.aob.mapper.BookMapper;
import com.aob.service.BookService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Desc: 接口实现类
 * @Author: ChenWenJie
 */
@Service("bookService")
public class BookServiceImpl implements BookService {

    @Autowired(required = false)
    private BookMapper bookMapper;

    public BookMapper getBookMapper() {
        return bookMapper;
    }

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int add(Book book) {
        return bookMapper.add(book);
    }

    @Override
    public int deleteBookById(Integer id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int update(Book book) {
        return bookMapper.update(book);
    }

    @Override
    public int getBookCount(Map<String, Object> map) {
        return bookMapper.getBookCount(map);
    }

    @Override
    public Book getBookById(Integer id) {
        return bookMapper.getBookById(id);
    }

    @Override
    public List<Book> getBookListByObj(Book book) {
        return bookMapper.getBookListByObj(book);
    }

    @Override
    public List<Book> getBookPageByMap(Map<String, Object> map) {
        return bookMapper.getBookPageByMap(map);
    }

    @Override
    public Book getBookByMap(Map<String, Object> map) {
        return bookMapper.getBookByMap(map);
    }
}
